using System.Text;

namespace MappingGenerator.Formatting
{
    public class AllCapsUnderscoreStringFormatter : StringFormatter
    {
        public override string Convert(string name)
        {
            var strings = RemovePrefixes(name).Split('_');
            var builder = new StringBuilder();
            foreach (var s in strings)
            {
                if (!string.IsNullOrEmpty(s))
                {
                    builder.Append(s[0].ToString().ToUpper());
                    if (s.Length > 1)
                        builder.Append(s.Substring(1).ToLower());
                }
            }
            return builder.ToString();

        }
    }
}